package com.aike.controller;

import com.aike.service.SeatService;
import org.omg.CORBA.INTERNAL;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

@ResponseBody
@Controller
@RequestMapping(value = "/Seat", produces={"text/html;charset=UTF-8;","application/json;"})
public class SeatController {
    @Autowired
    @Qualifier("seatServiceImpl")
    private SeatService seatService;

    @RequestMapping("/reserveSeat")
    public String reserveSeat(Integer personId, Integer seatId)
    {
        return seatService.reserveSeat(personId, seatId);
    }

    @RequestMapping("/showMySeat")
    public String showMySeat(Integer personId)
    {
        return seatService.selectMySeat(personId);
    }

    @RequestMapping("/releaseSeat")
    public String releaseSeat(Integer personId)
    {
        return seatService.releaseSeat(personId);
    }

    //回到位置
    @RequestMapping("/returnSeat")
    public String returnSeat(Integer personId)
    {
        return seatService.returnSeat(personId);
    }

    @RequestMapping("/pauseSeat")
    public String pauseSeat(Integer personId)
    {
        return seatService.pauseSeat(personId);
    }

}
